package strategy1.pay;

import lombok.Data;

import javax.annotation.Resource;

/**
 * @author ycd0075
 * @date 2023-04-27 17:53
 */
@Data
public class PaymentContext {

    @Resource
    private IPayment paymentStrategy;

    public PaymentContext(IPayment paymentStrategy) {
        this.paymentStrategy = paymentStrategy;
    }

    public Boolean pay(String paymentBody) {
        return this.paymentStrategy.pay(paymentBody);
    }
}
